import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class AnimationDemoPage extends GetView<AnimationDemoController> {
  const AnimationDemoPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return const HelloWidget();
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<AnimationDemoController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("animation_demo")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}

class AnimationFrameContainer extends StatefulWidget {
  const AnimationFrameContainer({
    super.key,
    required this.child,
  });
  final Widget child;
  @override
  State<AnimationFrameContainer> createState() =>
      _AnimationFrameContainerState();
}

class _AnimationFrameContainerState extends State<AnimationFrameContainer> {
  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        widget.child,
        Positioned(
            child: Container(
          color: Colors.amber,
        ))
      ],
    );
  }
}
